package fr.ulille1.fil.odeva;

import static org.junit.Assert.*;
import org.junit.*;

/*
 * Unit test for equals.
 */
public class MoneyEqualsTestCase
{
    private Money f12EUR,  f14EUR;
    private MoneyFactory mf;
    
    @Before
    public void init() throws UnexistingCurrencyException
    {
      mf=MoneyFactory.getDefaultFactory();
      f12EUR=mf.createMoney(12, "EUR");
      f14EUR=mf.createMoney(14, "EUR");
    }
    
    /**
     * equals
     */
    @Test
    public void equals() throws UnexistingCurrencyException{
    	Money moneyTmp=mf.createMoney(12, "EUR");
    	assertTrue(f12EUR.equals(moneyTmp));
    }
    /**
     * not equals
     */
    @Test
    public void notEquals() throws UnexistingCurrencyException{
    	Money moneyTmp=mf.createMoney(12, "EUR");
    	Money moneyUSTmp=mf.createMoney(12, "USD");
    	assertFalse(f14EUR.equals(moneyTmp));
    	assertFalse(f12EUR.equals(moneyUSTmp));
    }
}


